<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QxOrm: C:/Dvlp/_Perso/QxOrm/include/QxDao/QxSqlRelation_ManyToMany.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo_qxorm.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QxOrm
   &#160;<span id="projectnumber">1.4.3</span>
   </div>
   <div id="projectbrief">C++ Object Relational Mapping library</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_qx_sql_relation___many_to_many_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">QxSqlRelation_ManyToMany.h</div>  </div>
</div>
<div class="contents">
<a href="_qx_sql_relation___many_to_many_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/****************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">**</span>
<a name="l00003"></a>00003 <span class="comment">** http://www.qxorm.com/</span>
<a name="l00004"></a>00004 <span class="comment">** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)</span>
<a name="l00005"></a>00005 <span class="comment">**</span>
<a name="l00006"></a>00006 <span class="comment">** This file is part of the QxOrm library</span>
<a name="l00007"></a>00007 <span class="comment">**</span>
<a name="l00008"></a>00008 <span class="comment">** This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00009"></a>00009 <span class="comment">** warranty. In no event will the authors be held liable for any</span>
<a name="l00010"></a>00010 <span class="comment">** damages arising from the use of this software</span>
<a name="l00011"></a>00011 <span class="comment">**</span>
<a name="l00012"></a>00012 <span class="comment">** Commercial Usage</span>
<a name="l00013"></a>00013 <span class="comment">** Licensees holding valid commercial QxOrm licenses may use this file in</span>
<a name="l00014"></a>00014 <span class="comment">** accordance with the commercial license agreement provided with the</span>
<a name="l00015"></a>00015 <span class="comment">** Software or, alternatively, in accordance with the terms contained in</span>
<a name="l00016"></a>00016 <span class="comment">** a written agreement between you and Lionel Marty</span>
<a name="l00017"></a>00017 <span class="comment">**</span>
<a name="l00018"></a>00018 <span class="comment">** GNU General Public License Usage</span>
<a name="l00019"></a>00019 <span class="comment">** Alternatively, this file may be used under the terms of the GNU</span>
<a name="l00020"></a>00020 <span class="comment">** General Public License version 3.0 as published by the Free Software</span>
<a name="l00021"></a>00021 <span class="comment">** Foundation and appearing in the file &#39;license.gpl3.txt&#39; included in the</span>
<a name="l00022"></a>00022 <span class="comment">** packaging of this file. Please review the following information to</span>
<a name="l00023"></a>00023 <span class="comment">** ensure the GNU General Public License version 3.0 requirements will be</span>
<a name="l00024"></a>00024 <span class="comment">** met : http://www.gnu.org/copyleft/gpl.html</span>
<a name="l00025"></a>00025 <span class="comment">**</span>
<a name="l00026"></a>00026 <span class="comment">** If you are unsure which license is appropriate for your use, or</span>
<a name="l00027"></a>00027 <span class="comment">** if you have questions regarding the use of this file, please contact :</span>
<a name="l00028"></a>00028 <span class="comment">** contact@qxorm.com</span>
<a name="l00029"></a>00029 <span class="comment">**</span>
<a name="l00030"></a>00030 <span class="comment">****************************************************************************/</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#ifndef _QX_SQL_RELATION_MANY_TO_MANY_H_</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define _QX_SQL_RELATION_MANY_TO_MANY_H_</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#pragma once</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;<a class="code" href="_qx_sql_relation_8h.html" title="Base class for all relationships defined between 2 classes (or between 2 tables in database)...">QxDao/QxSqlRelation.h</a>&gt;</span>
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="keyword">namespace </span>qx {
<a name="l00049"></a>00049 
<a name="l00054"></a>00054 <span class="keyword">template</span> &lt;<span class="keyword">class</span> DataType, <span class="keyword">class</span> Owner&gt;
<a name="l00055"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html">00055</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html" title="qx::QxSqlRelation_ManyToMany&lt;DataType, Owner&gt; : manage a relationship many-to-many defined between 2 ...">QxSqlRelation_ManyToMany</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_sql_relation.html" title="qx::QxSqlRelation&lt;DataType, Owner&gt; : base class for all relationships defined between 2 classes (or b...">QxSqlRelation</a>&lt;DataType, Owner&gt;
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 <span class="keyword">private</span>:
<a name="l00059"></a>00059 
<a name="l00060"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a50efd4a49d1bd7521ae8a14e743c79b8">00060</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_relation.html#a9f3abb2f03c6ddd04c4c3e8d8dc9001b">QxSqlRelation&lt;DataType, Owner&gt;::type_owner</a> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a50efd4a49d1bd7521ae8a14e743c79b8">type_owner</a>;
<a name="l00061"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a16044d7327b50e1d3e01a2c9a92f04ad">00061</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_relation.html#a9aaeb0e5ead83d7a7b6ad14466f2e122">QxSqlRelation&lt;DataType, Owner&gt;::type_data</a> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a16044d7327b50e1d3e01a2c9a92f04ad">type_data</a>;
<a name="l00062"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a661071597ed75ed21585685763c4a2c2">00062</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1_qx_sql_relation.html#aa5f10102dfa6a3691a07602957b57385">QxSqlRelation&lt;DataType, Owner&gt;::type_container</a> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a661071597ed75ed21585685763c4a2c2">type_container</a>;
<a name="l00063"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a9f7ab8ddeb1455bfa6b52c5f6066bd88">00063</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structqx_1_1trait_1_1generic__container.html" title="qx::trait::generic_container&lt;T&gt; : provide some tools to manage all containers without knowing its typ...">QxSqlRelation&lt;DataType, Owner&gt;::type_generic_container</a> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a9f7ab8ddeb1455bfa6b52c5f6066bd88">type_generic_container</a>;
<a name="l00064"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#aac26759ad8977ed14959930f59fb6794">00064</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1trait_1_1no__type.html">QxSqlRelation&lt;DataType, Owner&gt;::type_item</a> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#aac26759ad8977ed14959930f59fb6794">type_item</a>;
<a name="l00065"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a8a61ac3c206aa1efff94bd9ef4fd0929">00065</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1trait_1_1no__type.html">type_generic_container::type_iterator</a> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a8a61ac3c206aa1efff94bd9ef4fd0929">type_iterator</a>;
<a name="l00066"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab898b3c0399c4caf330ed13117a80f03">00066</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> type_item::type_value <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab898b3c0399c4caf330ed13117a80f03">type_value</a>;
<a name="l00067"></a>00067 
<a name="l00068"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a109f2f4561e2e8b770639c2d62af2875a84e45c22073a3bff1082dbb855451d89">00068</a>    <span class="keyword">enum</span> { <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a109f2f4561e2e8b770639c2d62af2875a84e45c22073a3bff1082dbb855451d89">is_data_container</a> = <a class="code" href="classqx_1_1_qx_sql_relation.html" title="qx::QxSqlRelation&lt;DataType, Owner&gt; : base class for all relationships defined between 2 classes (or b...">QxSqlRelation&lt;DataType, Owner&gt;::is_data_container</a> };
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="keyword">public</span>:
<a name="l00071"></a>00071 
<a name="l00072"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a473846e5ff63421a68a7190a7232e937">00072</a>    <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a473846e5ff63421a68a7190a7232e937">QxSqlRelation_ManyToMany</a>(<a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * p, <span class="keyword">const</span> QString &amp; sExtraTable, <span class="keyword">const</span> QString &amp; sForeignKeyOwner, <span class="keyword">const</span> QString &amp; sForeignKeyDataType) : <a class="code" href="classqx_1_1_qx_sql_relation.html" title="qx::QxSqlRelation&lt;DataType, Owner&gt; : base class for all relationships defined between 2 classes (or b...">QxSqlRelation</a>&lt;DataType, Owner&gt;(p) { this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#afeefe51eff98030b99dc3bb876b0b1e4" title="Relation type : one-to-one, one-to-many, etc.">m_eRelationType</a> = <a class="code" href="classqx_1_1_ix_sql_relation.html#a441efa61172fbe9986756e69693c60c1a82c35898d56b6560a90752ef529860fd">qx::IxSqlRelation::many_to_many</a>; this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a1d827662da88d7255d2815744f37cec5" title="Extra-table that holds the relationship (n-n)">m_sExtraTable</a> = sExtraTable; this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#af2bea6fa72294403a5beeab322f45c98" title="SQL query foreign key for owner (n-n)">m_sForeignKeyOwner</a> = sForeignKeyOwner; this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a2c0cd8369351ed701bd953ea464b36de" title="SQL query foreign key for data type (n-n)">m_sForeignKeyDataType</a> = sForeignKeyDataType; this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a7bb17b61acd9c8db7bf07b49da12e330">verifyParameters</a>(); }
<a name="l00073"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a5d269493f9ff4d4bdbd0153ddb911fa4">00073</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a5d269493f9ff4d4bdbd0153ddb911fa4">~QxSqlRelation_ManyToMany</a>() { BOOST_STATIC_ASSERT(<a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a109f2f4561e2e8b770639c2d62af2875a84e45c22073a3bff1082dbb855451d89">is_data_container</a>); }
<a name="l00074"></a>00074 
<a name="l00075"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#aecddb69ab29a8d33d403e0599617a056">00075</a>    <span class="keyword">virtual</span> QString <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#aecddb69ab29a8d33d403e0599617a056">getDescription</a>()<span class="keyword"> const                                     </span>{ <span class="keywordflow">return</span> <span class="stringliteral">&quot;relation many-to-many&quot;</span>; }
<a name="l00076"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ae1f424f9f20ef3ce61e03b4bdd71d89e">00076</a>    <span class="keyword">virtual</span> QString <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ae1f424f9f20ef3ce61e03b4bdd71d89e">getExtraTable</a>()<span class="keyword"> const                                      </span>{ <span class="keywordflow">return</span> this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a1d827662da88d7255d2815744f37cec5" title="Extra-table that holds the relationship (n-n)">m_sExtraTable</a>; }
<a name="l00077"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab39cafe004e1cc48fe45b54242266b31">00077</a>    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab39cafe004e1cc48fe45b54242266b31">getCartesianProduct</a>()<span class="keyword"> const                                   </span>{ <span class="keywordflow">return</span> <span class="keyword">true</span>; }
<a name="l00078"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a9dcd1a1ef60b0c7d0e5b7ed7aae0dea3">00078</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a9dcd1a1ef60b0c7d0e5b7ed7aae0dea3">createTable</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const               </span>{ Q_UNUSED(params); }
<a name="l00079"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ae60c9dbb59470e954354eefca0a07ada">00079</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ae60c9dbb59470e954354eefca0a07ada">lazySelect</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const                </span>{ Q_UNUSED(params); }
<a name="l00080"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a13848126238cde22e96edf032a9480df">00080</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a13848126238cde22e96edf032a9480df">lazyFrom</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const                  </span>{ Q_UNUSED(params); }
<a name="l00081"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ad8754236dbc1754cc259678a81dfbe0d">00081</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ad8754236dbc1754cc259678a81dfbe0d">eagerFrom</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const                 </span>{ Q_UNUSED(params); }
<a name="l00082"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a5fc06fa263989a50098bf54c43d10d52">00082</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a5fc06fa263989a50098bf54c43d10d52">lazyJoin</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const                  </span>{ Q_UNUSED(params); }
<a name="l00083"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a49bda71751c9a30983b4d841ef7bd65e">00083</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a49bda71751c9a30983b4d841ef7bd65e">lazyWhere</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const                 </span>{ Q_UNUSED(params); }
<a name="l00084"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a1d2c5b58e6e0cd13894bfb480a748209">00084</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a1d2c5b58e6e0cd13894bfb480a748209">eagerWhere</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const                </span>{ Q_UNUSED(params); }
<a name="l00085"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a71494a333825e67b951a27d734d00fe1">00085</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a71494a333825e67b951a27d734d00fe1">lazyWhereSoftDelete</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const       </span>{ Q_UNUSED(params); }
<a name="l00086"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a533297b61c0ed266636c6aac931136cd">00086</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a533297b61c0ed266636c6aac931136cd">lazyFetch_ResolveInput</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const    </span>{ Q_UNUSED(params); }
<a name="l00087"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a79b840be0576354ebb6659d5aaaac29e">00087</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a79b840be0576354ebb6659d5aaaac29e">eagerFetch_ResolveInput</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const   </span>{ Q_UNUSED(params); }
<a name="l00088"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a6e133cbdbf6cc2b173af08e6f4677e3e">00088</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a6e133cbdbf6cc2b173af08e6f4677e3e">lazyFetch_ResolveOutput</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const   </span>{ Q_UNUSED(params); }
<a name="l00089"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a1cd81a9241c73d31ce0ee4b7a03fae3d">00089</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a1cd81a9241c73d31ce0ee4b7a03fae3d">lazyInsert</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const                </span>{ Q_UNUSED(params); }
<a name="l00090"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a5e47e5feae62aa1067e4bdda94628018">00090</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a5e47e5feae62aa1067e4bdda94628018">lazyInsert_Values</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const         </span>{ Q_UNUSED(params); }
<a name="l00091"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a612a330709b7c9b810c1c4ee818aa3dc">00091</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a612a330709b7c9b810c1c4ee818aa3dc">lazyUpdate</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const                </span>{ Q_UNUSED(params); }
<a name="l00092"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab4fc6e64adb4960c02b4ea396cf57694">00092</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab4fc6e64adb4960c02b4ea396cf57694">lazyInsert_ResolveInput</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const   </span>{ Q_UNUSED(params); }
<a name="l00093"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#acd8b8eaa36808654772f8622ddf409b5">00093</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#acd8b8eaa36808654772f8622ddf409b5">lazyUpdate_ResolveInput</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const   </span>{ Q_UNUSED(params); }
<a name="l00094"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a02b071ca548d0736193a463d7c59aba4">00094</a>    <span class="keyword">virtual</span> QSqlError <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a02b071ca548d0736193a463d7c59aba4">onBeforeSave</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const         </span>{ Q_UNUSED(params); <span class="keywordflow">return</span> QSqlError(); }
<a name="l00095"></a>00095 
<a name="l00096"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a189d8811ac78b64d2d23b92372208536">00096</a>    <span class="keyword">virtual</span> QVariant <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a189d8811ac78b64d2d23b92372208536">getIdFromQuery</a>(<span class="keywordtype">bool</span> bEager, <a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const</span>
<a name="l00097"></a>00097 <span class="keyword">   </span>{ <span class="keywordflow">return</span> this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a61a713ffc69396decf7eaf68f76788e1">getIdFromQuery_ManyToMany</a>(bEager, params); }
<a name="l00098"></a>00098 
<a name="l00099"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#abea90a8fbc9b4096d93eb2da49c2e6aa">00099</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#abea90a8fbc9b4096d93eb2da49c2e6aa">updateOffset</a>(<span class="keywordtype">bool</span> bEager, <a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const</span>
<a name="l00100"></a>00100 <span class="keyword">   </span>{ this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#afa0958136ac637f0c6ff4c11d1f21128">updateOffset_ManyToMany</a>(bEager, params); }
<a name="l00101"></a>00101 
<a name="l00102"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab42fac01ef402e71e1eb21c543cd37a1">00102</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab42fac01ef402e71e1eb21c543cd37a1">eagerSelect</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const</span>
<a name="l00103"></a>00103 <span class="keyword">   </span>{ this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a32234b612d0fffee79b880f5ac9748fe">eagerSelect_ManyToMany</a>(params); }
<a name="l00104"></a>00104 
<a name="l00105"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a4ff109f553e26cabfcba275e7cccb682">00105</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a4ff109f553e26cabfcba275e7cccb682">eagerJoin</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const</span>
<a name="l00106"></a>00106 <span class="keyword">   </span>{ this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#af45b8ae0c2ae1ab88023b792921c4465">eagerJoin_ManyToMany</a>(params); }
<a name="l00107"></a>00107 
<a name="l00108"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab3f8a6ae328948db7d40d3c6f4058217">00108</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab3f8a6ae328948db7d40d3c6f4058217">eagerWhereSoftDelete</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const</span>
<a name="l00109"></a>00109 <span class="keyword">   </span>{ this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a0c2f21341516ab30f2aea7189e2168c3">eagerWhereSoftDelete_ManyToMany</a>(params); }
<a name="l00110"></a>00110 
<a name="l00111"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a4e3c7c2af84b6c90afca1c949f7e5318">00111</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> * <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a4e3c7c2af84b6c90afca1c949f7e5318">eagerFetch_ResolveOutput</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const</span>
<a name="l00112"></a>00112 <span class="keyword">   </span>{
<a name="l00113"></a>00113       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#af33eabc335977732a6481ccd434e0df4">verifyOffset</a>(params, <span class="keyword">true</span>)) { <span class="keywordflow">return</span> NULL; }
<a name="l00114"></a>00114       QSqlQuery &amp; query = params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a004c29f4ef96ed2891b9f8d1d12e27b8">query</a>();
<a name="l00115"></a>00115       <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * p = NULL; <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * pId = this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a3f3d150e5a4fb774df53d2ea2df2f249">getDataId</a>(); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(pId);
<a name="l00116"></a>00116       <span class="keywordtype">long</span> lIndex = 0; <span class="keywordtype">long</span> lOffsetId = (pId ? pId-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aa2599d94e81602d2f0fc6c018328f446">getNameCount</a>() : 0); <span class="keywordtype">bool</span> bValidId(<span class="keyword">false</span>);
<a name="l00117"></a>00117       <span class="keywordtype">long</span> lOffsetOld = params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#abc497ede45c2dae2ece234e38f7b13df">offset</a>(); this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#abea90a8fbc9b4096d93eb2da49c2e6aa">updateOffset</a>(<span class="keyword">true</span>, params);
<a name="l00118"></a>00118       <span class="keywordtype">long</span> lRelation = 0; <a class="code" href="classqx_1_1_ix_sql_relation.html" title="qx::IxSqlRelation : common interface for all relationships defined between 2 classes (or between 2 ta...">IxSqlRelation</a> * pRelation = NULL;
<a name="l00119"></a>00119       <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; pId-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aa2599d94e81602d2f0fc6c018328f446">getNameCount</a>(); i++)
<a name="l00120"></a>00120       { QVariant v = query.value(lOffsetOld + i); bValidId = (bValidId || <a class="code" href="namespaceqx_1_1trait.html#a752ada47a935cfc82ffe1b17dadd6e72">qx::trait::is_valid_primary_key</a>(v)); }
<a name="l00121"></a>00121       <span class="keywordflow">if</span> (! bValidId) { <span class="keywordflow">return</span> NULL; }
<a name="l00122"></a>00122 
<a name="l00123"></a>00123       <a class="code" href="classqx_1_1trait_1_1no__type.html">type_item</a> item = this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation.html#a394fcd53b79345d684d351fd00881eb1">createItem</a>();
<a name="l00124"></a>00124       <a class="code" href="classqx_1_1_qx_sql_relation.html#a9aaeb0e5ead83d7a7b6ad14466f2e122">type_data</a> &amp; item_val = item.value_qx();
<a name="l00125"></a>00125       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation.html#a155eb6ac8002fec56efcbcd3648d7c22">callTriggerBeforeFetch</a>(item_val, params)) { <span class="keywordflow">return</span> NULL; }
<a name="l00126"></a>00126       <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; pId-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aa2599d94e81602d2f0fc6c018328f446">getNameCount</a>(); i++)
<a name="l00127"></a>00127       { QVariant v = query.value(lOffsetOld + i); <a class="code" href="namespaceqx_1_1cvt.html#a38fbb18bd04613956f3900604f5746be">qx::cvt::from_variant</a>(v, item.key(), <span class="stringliteral">&quot;&quot;</span>, i, <a class="code" href="structqx_1_1cvt_1_1context.html#ade79c85929462745a3adcdf310c91a93a5fe28c5356333a6d2633c93cbd6e48e5">qx::cvt::context::e_database</a>); }
<a name="l00128"></a>00128       <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; pId-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aa2599d94e81602d2f0fc6c018328f446">getNameCount</a>(); i++)
<a name="l00129"></a>00129       { QVariant v = query.value(lOffsetOld + i); pId-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#ab745b2a043797eecfe769c3f51257a35">fromVariant</a>((&amp; item_val), v, <span class="stringliteral">&quot;&quot;</span>, i, <a class="code" href="structqx_1_1cvt_1_1context.html#ade79c85929462745a3adcdf310c91a93a5fe28c5356333a6d2633c93cbd6e48e5">qx::cvt::context::e_database</a>); }
<a name="l00130"></a>00130       <span class="keywordtype">long</span> lOffsetRelation = (lOffsetOld + lOffsetId); <span class="keywordtype">long</span> lCurrIndex = 0;
<a name="l00131"></a>00131       <span class="keywordflow">while</span> ((p = this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a5a8db73ceae8007f07be60cd7ae20dcd">nextData</a>(lIndex)))
<a name="l00132"></a>00132       { <span class="keywordflow">if</span> (params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#aabae131097d33ab208c7d36d89094de5">checkColumns</a>(p-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aaf7b8145ed3e5a4708ff713951629744">getKey</a>())) { p-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#ab745b2a043797eecfe769c3f51257a35">fromVariant</a>((&amp; item_val), query.value(lCurrIndex + lOffsetRelation), -1, <a class="code" href="structqx_1_1cvt_1_1context.html#ade79c85929462745a3adcdf310c91a93a5fe28c5356333a6d2633c93cbd6e48e5">qx::cvt::context::e_database</a>); lCurrIndex++; } }
<a name="l00133"></a>00133 
<a name="l00134"></a>00134       <span class="keywordflow">if</span> (params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a78bc1c49214f1681b0b26ecf31e42b4b">relationX</a>())
<a name="l00135"></a>00135       {
<a name="l00136"></a>00136          <span class="keywordtype">long</span> lOffsetCurrent = (lCurrIndex + lOffsetRelation);
<a name="l00137"></a>00137          <span class="keywordtype">long</span> lIndexOwnerOld = params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a74d1d10b37d8b26711ce539459d14efe">indexOwner</a>(); params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a52b38457e3acf39299cc9f5d6e443835">setIndexOwner</a>(params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a9e4cc344e92f94c091fe3239e8c9606b">index</a>());
<a name="l00138"></a>00138          <span class="keywordtype">void</span> * pOwnerOld = params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#ab814ecb53d7247de54b0badd3c97fc0d">owner</a>(); params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a053d86dd38e5a3298e64b02ce77935fb">setOwner</a>(&amp; item_val);
<a name="l00139"></a>00139          lOffsetOld = params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#abc497ede45c2dae2ece234e38f7b13df">offset</a>(); params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a13d36ae95132b41ce06f4ec8b922f1c0">setOffset</a>(lOffsetCurrent);
<a name="l00140"></a>00140          <span class="keywordflow">while</span> ((pRelation = this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a69766925bc960fa91313c918c49b2476">nextRelation</a>(lRelation)))
<a name="l00141"></a>00141          { <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#ae7936f9dac464d0382df509da12b0c5b">addLazyRelation</a>(params, pRelation)) { pRelation-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a58a02ae9bd627892325950ab69093604">lazyFetch_ResolveOutput</a>(params); } }
<a name="l00142"></a>00142          params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a053d86dd38e5a3298e64b02ce77935fb">setOwner</a>(pOwnerOld); params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a13d36ae95132b41ce06f4ec8b922f1c0">setOffset</a>(lOffsetOld);
<a name="l00143"></a>00143          params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a52b38457e3acf39299cc9f5d6e443835">setIndexOwner</a>(lIndexOwnerOld);
<a name="l00144"></a>00144       }
<a name="l00145"></a>00145 
<a name="l00146"></a>00146       <span class="keywordflow">if</span> (! this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation.html#a2349b717af0c614cde745905820eeaf1">callTriggerAfterFetch</a>(item_val, params)) { <span class="keywordflow">return</span> NULL; }
<a name="l00147"></a>00147       <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#ab898b3c0399c4caf330ed13117a80f03">type_value</a> * pValue = type_generic_container::insertItem(this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation.html#a7bad56d186c0df3cc7b3159d40fcdb56">getContainer</a>(params), item);
<a name="l00148"></a>00148       <span class="keywordflow">if</span> (! type_item::is_value_pointer &amp;&amp; pValue) { <span class="keywordflow">return</span> pValue; }
<a name="l00149"></a>00149       <span class="keywordflow">return</span> (&amp; item_val);
<a name="l00150"></a>00150    }
<a name="l00151"></a>00151 
<a name="l00152"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#abf1212ff78c047ebb0832c41217670ff">00152</a>    <span class="keyword">virtual</span> QSqlError <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#abf1212ff78c047ebb0832c41217670ff">onAfterSave</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const</span>
<a name="l00153"></a>00153 <span class="keyword">   </span>{
<a name="l00154"></a>00154       QSqlError daoError;
<a name="l00155"></a>00155       <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation.html#aeaab7a9bd52b82e58f65adf7a6b64dd6">isNullData</a>(params)) { <span class="keywordflow">return</span> this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a31c14185f5d4216c69b2c86e1d0f1ca1">deleteFromExtraTable</a>(params); }
<a name="l00156"></a>00156       <span class="keywordflow">if</span> (! params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a586558db71d817109e09818957f319da">recursiveMode</a>()) { daoError = <a class="code" href="group___qx_dao.html#ga100e9d635a4720ed9512799ba0ea519b" title="Insert (if no exist) or update (if already exist) an element or a list of elements into database...">qx::dao::save</a>(this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation.html#a7bad56d186c0df3cc7b3159d40fcdb56">getContainer</a>(params), (&amp; params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a7f7169ed967f39a124e9aced8592620a">database</a>())); }
<a name="l00157"></a>00157       <span class="keywordflow">else</span> { daoError = <a class="code" href="group___qx_dao.html#gadf265ab7dd42ab831dbb94bf5aeeafd3" title="Insert (if no exist) or update (if already exist) recursively an element and all levels of relationsh...">qx::dao::save_with_relation_recursive</a>(this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation.html#a7bad56d186c0df3cc7b3159d40fcdb56">getContainer</a>(params), params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a521ccbe660f9f7aa405ed256d52e59be">saveMode</a>(), (&amp; params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a7f7169ed967f39a124e9aced8592620a">database</a>()), (&amp; params)); }
<a name="l00158"></a>00158       <span class="keywordflow">if</span> (daoError.isValid()) { <span class="keywordflow">return</span> daoError; }
<a name="l00159"></a>00159       daoError = this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a31c14185f5d4216c69b2c86e1d0f1ca1">deleteFromExtraTable</a>(params);
<a name="l00160"></a>00160       <span class="keywordflow">if</span> (daoError.isValid()) { <span class="keywordflow">return</span> daoError; }
<a name="l00161"></a>00161       daoError = this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a61fa34d4bd46778ae4643b8c4f3d1fbb">insertIntoExtraTable</a>(params);
<a name="l00162"></a>00162       <span class="keywordflow">if</span> (daoError.isValid()) { <span class="keywordflow">return</span> daoError; }
<a name="l00163"></a>00163       <span class="keywordflow">return</span> QSqlError();
<a name="l00164"></a>00164    }
<a name="l00165"></a>00165 
<a name="l00166"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a2e2b29edd1dc43c27884faac60ff478b">00166</a>    <span class="keyword">virtual</span> QString <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a2e2b29edd1dc43c27884faac60ff478b">createExtraTable</a>()<span class="keyword"> const</span>
<a name="l00167"></a>00167 <span class="keyword">   </span>{ <span class="keywordflow">return</span> this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a5afd55f94812c9be5a034fb3f762fc3b">createExtraTable_ManyToMany</a>(); }
<a name="l00168"></a>00168 
<a name="l00169"></a>00169 <span class="keyword">private</span>:
<a name="l00170"></a>00170 
<a name="l00171"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a7bb17b61acd9c8db7bf07b49da12e330">00171</a>    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a7bb17b61acd9c8db7bf07b49da12e330">verifyParameters</a>()
<a name="l00172"></a>00172    { <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(! this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a1d827662da88d7255d2815744f37cec5" title="Extra-table that holds the relationship (n-n)">m_sExtraTable</a>.isEmpty() &amp;&amp; ! this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#af2bea6fa72294403a5beeab322f45c98" title="SQL query foreign key for owner (n-n)">m_sForeignKeyOwner</a>.isEmpty() &amp;&amp; ! this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a2c0cd8369351ed701bd953ea464b36de" title="SQL query foreign key for data type (n-n)">m_sForeignKeyDataType</a>.isEmpty() &amp;&amp; (this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#af2bea6fa72294403a5beeab322f45c98" title="SQL query foreign key for owner (n-n)">m_sForeignKeyOwner</a> != this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a2c0cd8369351ed701bd953ea464b36de" title="SQL query foreign key for data type (n-n)">m_sForeignKeyDataType</a>)); }
<a name="l00173"></a>00173 
<a name="l00174"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a31c14185f5d4216c69b2c86e1d0f1ca1">00174</a>    QSqlError <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a31c14185f5d4216c69b2c86e1d0f1ca1">deleteFromExtraTable</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const</span>
<a name="l00175"></a>00175 <span class="keyword">   </span>{ <span class="keywordflow">return</span> this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#ae5615d604e0567ee74a5dd7ce7313b08">deleteFromExtraTable_ManyToMany</a>(params); }
<a name="l00176"></a>00176 
<a name="l00177"></a><a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a61fa34d4bd46778ae4643b8c4f3d1fbb">00177</a>    QSqlError <a class="code" href="classqx_1_1_qx_sql_relation___many_to_many.html#a61fa34d4bd46778ae4643b8c4f3d1fbb">insertIntoExtraTable</a>(<a class="code" href="classqx_1_1_qx_sql_relation_params.html" title="qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...">QxSqlRelationParams</a> &amp; params)<span class="keyword"> const</span>
<a name="l00178"></a>00178 <span class="keyword">   </span>{
<a name="l00179"></a>00179       <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * pIdOwner = this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#add2fe91470fe34ab65862e9bdeda69be">getDataIdOwner</a>(); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(pIdOwner);
<a name="l00180"></a>00180       <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * pIdData = this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a3f3d150e5a4fb774df53d2ea2df2f249">getDataId</a>(); <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(pIdData);
<a name="l00181"></a>00181       <span class="keywordflow">if</span> (! pIdOwner || ! pIdData) { <span class="keywordflow">return</span> QSqlError(); }
<a name="l00182"></a>00182       QStringList lstForeignKeyOwner = this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#af2bea6fa72294403a5beeab322f45c98" title="SQL query foreign key for owner (n-n)">m_sForeignKeyOwner</a>.split(<span class="stringliteral">&quot;|&quot;</span>);
<a name="l00183"></a>00183       QStringList lstForeignKeyDataType = this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a2c0cd8369351ed701bd953ea464b36de" title="SQL query foreign key for data type (n-n)">m_sForeignKeyDataType</a>.split(<span class="stringliteral">&quot;|&quot;</span>);
<a name="l00184"></a>00184       <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(pIdOwner-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aa2599d94e81602d2f0fc6c018328f446">getNameCount</a>() == lstForeignKeyOwner.count());
<a name="l00185"></a>00185       <a class="code" href="_qx_macro_8h.html#a70ab6c4ed8eb3e23107f171e0b41d612">qAssert</a>(pIdData-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#aa2599d94e81602d2f0fc6c018328f446">getNameCount</a>() == lstForeignKeyDataType.count());
<a name="l00186"></a>00186 
<a name="l00187"></a>00187       QString sql = <span class="stringliteral">&quot;INSERT INTO &quot;</span> + this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a1d827662da88d7255d2815744f37cec5" title="Extra-table that holds the relationship (n-n)">m_sExtraTable</a> + <span class="stringliteral">&quot; (&quot;</span>;
<a name="l00188"></a>00188       sql += pIdOwner-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#a81a6123665bb2d7f3f8ccc750fbf83ce">getSqlName</a>(<span class="stringliteral">&quot;, &quot;</span>, this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#af2bea6fa72294403a5beeab322f45c98" title="SQL query foreign key for owner (n-n)">m_sForeignKeyOwner</a>) + <span class="stringliteral">&quot;, &quot;</span> + pIdData-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#a81a6123665bb2d7f3f8ccc750fbf83ce">getSqlName</a>(<span class="stringliteral">&quot;, &quot;</span>, this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a2c0cd8369351ed701bd953ea464b36de" title="SQL query foreign key for data type (n-n)">m_sForeignKeyDataType</a>);
<a name="l00189"></a>00189       sql += <span class="stringliteral">&quot;) VALUES (&quot;</span>;
<a name="l00190"></a>00190       sql += pIdOwner-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#a830fb9e6e026b3ec51d77b384e458ae0">getSqlPlaceHolder</a>(<span class="stringliteral">&quot;&quot;</span>, -1, <span class="stringliteral">&quot;, &quot;</span>, this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#af2bea6fa72294403a5beeab322f45c98" title="SQL query foreign key for owner (n-n)">m_sForeignKeyOwner</a>) + <span class="stringliteral">&quot;, &quot;</span> + pIdData-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#a830fb9e6e026b3ec51d77b384e458ae0">getSqlPlaceHolder</a>(<span class="stringliteral">&quot;&quot;</span>, -1, <span class="stringliteral">&quot;, &quot;</span>, this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a2c0cd8369351ed701bd953ea464b36de" title="SQL query foreign key for data type (n-n)">m_sForeignKeyDataType</a>) + <span class="stringliteral">&quot;)&quot;</span>;
<a name="l00191"></a>00191       <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#ac4767f67a6b39eafefd972a8b207ebf1">traceSqlQuery</a>()) { qDebug(<span class="stringliteral">&quot;[QxOrm] sql query (extra-table) : %s&quot;</span>, qPrintable(sql)); }
<a name="l00192"></a>00192 
<a name="l00193"></a>00193       <a class="code" href="classqx_1_1trait_1_1no__type.html">type_item</a> item;
<a name="l00194"></a>00194       <a class="code" href="classqx_1_1_qx_sql_relation.html#aa5f10102dfa6a3691a07602957b57385">type_container</a> &amp; container = this-&gt;<a class="code" href="classqx_1_1_qx_sql_relation.html#a7bad56d186c0df3cc7b3159d40fcdb56">getContainer</a>(params);
<a name="l00195"></a>00195       <a class="code" href="classqx_1_1trait_1_1no__type.html">type_iterator</a> itr = type_generic_container::begin(container, item);
<a name="l00196"></a>00196       <a class="code" href="classqx_1_1trait_1_1no__type.html">type_iterator</a> itr_end = type_generic_container::end(container);
<a name="l00197"></a>00197       QSqlQuery queryInsert(params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#a7f7169ed967f39a124e9aced8592620a">database</a>());
<a name="l00198"></a>00198       <span class="keywordflow">if</span> (! queryInsert.prepare(sql)) { <span class="keywordflow">return</span> queryInsert.lastError(); }
<a name="l00199"></a>00199 
<a name="l00200"></a>00200       <span class="keywordflow">while</span> (itr != itr_end)
<a name="l00201"></a>00201       {
<a name="l00202"></a>00202          pIdOwner-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#abb719e3cd22840effe36f0d9c1c8f10c">setSqlPlaceHolder</a>(queryInsert, params.<a class="code" href="classqx_1_1_qx_sql_relation_params.html#ab814ecb53d7247de54b0badd3c97fc0d">owner</a>(), <span class="stringliteral">&quot;&quot;</span>, this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#af2bea6fa72294403a5beeab322f45c98" title="SQL query foreign key for owner (n-n)">m_sForeignKeyOwner</a>);
<a name="l00203"></a>00203          pIdData-&gt;<a class="code" href="classqx_1_1_ix_data_member.html#abb719e3cd22840effe36f0d9c1c8f10c">setSqlPlaceHolder</a>(queryInsert, (&amp; item.value_qx()), <span class="stringliteral">&quot;&quot;</span>, this-&gt;<a class="code" href="classqx_1_1_ix_sql_relation.html#a2c0cd8369351ed701bd953ea464b36de" title="SQL query foreign key for data type (n-n)">m_sForeignKeyDataType</a>);
<a name="l00204"></a>00204          <span class="keywordflow">if</span> (! queryInsert.exec()) { <span class="keywordflow">return</span> queryInsert.lastError(); }
<a name="l00205"></a>00205          itr = type_generic_container::next(container, itr, item);
<a name="l00206"></a>00206       }
<a name="l00207"></a>00207 
<a name="l00208"></a>00208       <span class="keywordflow">return</span> QSqlError();
<a name="l00209"></a>00209    }
<a name="l00210"></a>00210 
<a name="l00211"></a>00211 };
<a name="l00212"></a>00212 
<a name="l00213"></a>00213 } <span class="comment">// namespace qx</span>
<a name="l00214"></a>00214 
<a name="l00215"></a>00215 <span class="preprocessor">#endif // _QX_SQL_RELATION_MANY_TO_MANY_H_</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_qx_sql_relation___many_to_many_8h.html">QxSqlRelation_ManyToMany.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Sun Dec 11 2016 13:41:04 for QxOrm by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
